package com.changgou;

import com.changgou.util.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

/*****
 * @Author: 黑马训练营
 * @Description: com.changgou.goods
 ****/
@SpringBootApplication
@EnableEurekaClient
@MapperScan(basePackages = "com.changgou.goods.dao") //Dao接口扫描
public class GoodsApplication {

    public static void main(String[] args) {
        ApplicationContext act = SpringApplication.run(GoodsApplication.class,args);
    }


    /***
     * 将IdWorker注入到SpringIOC容器中
     * @Bean注解
     *      该注解使用在方法上，可以将方法的返回值注入到SpringIOC容器中
     */
    @Bean
    public IdWorker idWorker(){
        return new IdWorker();
    }

}
